package com.wandon.ww.common.exception;

import com.wandon.ww.model.vo.common.ResultCodeEnum;
import lombok.Data;

@Data
public class WwException extends RuntimeException{

    private Integer code;

    private String message;

    private ResultCodeEnum resultCodeEnum;

    public WwException(ResultCodeEnum resultCodeEnum){
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

    public WwException(Integer code, String message){
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
